package com.codeoss.framework.view.pagebean.crud;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.codeoss.framework.data.metadata.Table;

public class UpdateRequest {
	private Table mainTable;
	private Map<String,Object> mainDataMap;
	private List<Table> subTableList=new ArrayList<Table>();
	private Map<String,List<Map<String,Object>>> subDataMap=new HashMap<String,List<Map<String,Object>>>();
	private boolean batchSave;
	public Table getMainTable() {
		return mainTable;
	}
	public void setMainTable(Table mainTable) {
		this.mainTable = mainTable;
	}
	public Map<String, Object> getMainDataMap() {
		return mainDataMap;
	}
	public void setMainDataMap(Map<String, Object> mainDataMap) {
		this.mainDataMap = mainDataMap;
	}
	public List<Table> getSubTableList() {
		return subTableList;
	}
	public void setSubTableList(List<Table> subTableList) {
		this.subTableList = subTableList;
	}
	
	public Map<String, List<Map<String, Object>>> getSubDataMap() {
		return subDataMap;
	}
	public void setSubDataMap(Map<String, List<Map<String, Object>>> subDataMap) {
		this.subDataMap = subDataMap;
	}
	public boolean isBatchSave() {
		return batchSave;
	}
	public void setBatchSave(boolean batchSave) {
		this.batchSave = batchSave;
	}
	
	public void addSubTable(Table table) {
		subTableList.add(table);
	}
	
	public void addSubData(String tableName,List<Map<String, Object>> subDataList) {
		subDataMap.put(tableName, subDataList);
	}
}
